// 设计注册成功对话框

// 关闭VSCode非必要报警
// ignore_for_file: sized_box_for_whitespace, must_be_immutable, unnecessary_brace_in_string_interps, non_constant_identifier_names

import 'package:flutter/material.dart';
import 'package:project_award_statistics/utils/mobile_material_design/my_button.dart';

class DialogRegisterSuccess extends StatelessWidget {
  String stu_name;
  DialogRegisterSuccess({
    super.key,
    required this.stu_name,
  });

  // 提醒:尽量不要,不要使用绝对布局,因为不同安卓设备的分辨率不一样!!!

  @override
  Widget build(BuildContext context) {
    return AlertDialog(
      backgroundColor: Theme.of(context).colorScheme.surface,
      content: Container(
        height: 180,width: 400,   // 设置对话框大小
        child: Column(     // 设置行式布局
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Center(    // 居中显示"注册信息"字样
              child: Text(
                "注册信息提示",
                style: TextStyle(
                  fontSize: 20,
                ),
              ),
            ),
            // SizedBox(height: 30,),   // 设置上下控件间间隔
            Center(
              child:
                Column(
                  children: [   // 分别在一个子行内设置两行文本
                    Text(
                      "注册成功!",
                      style: TextStyle(
                        fontSize: 20,
                      ),
                    ),
                    Text(
                      "欢迎新用户:${stu_name}",
                      style: TextStyle(
                        fontSize: 20,
                      ),
                    ),
                  ],
                ),
            ),
            // SizedBox(height: 45,),
            Container(
              height:40,width: 140,
              child:
                MyButton(
                  text: "确认", 
                  onPressed: ()=>Navigator.of(context).pop(),
                ),
            ),
          ],
        ),
      ),
    );
  }
}
